<template>
    <div></div>
</template>
<script>
import api from '@/config/server.js'
import qs from 'qs'
export default {
  mounted () {
    let code = this.$route.query.code
    if (code) {
      this.$axios.get(api.github_login + '?' + qs.stringify({code: code})).then(({data}) => {
        console.log(data)
        this.$router.push('/main')
      })
    } else {
      this.$router.push('/login')
    }
  }
}
</script>
